package com.cn.hospital.service.impl.auth;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cn.hospital.mapper.SysUserMapper;
import com.cn.hospital.service.auth.SysUserService;
import com.cn.hospital.entity.SysUser;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

@Service(interfaceClass = SysUserService.class)
public class SysSysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {

    @Autowired
    SysUserMapper sysUserMapper;

    @Override
    public SysUser getByUsername(String username) {
        LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SysUser::getUserName, username);
        return getOne(queryWrapper);
    }

    @Override
    public SysUser findById(int id) {
        return sysUserMapper.findById(id);
    }


}
